import { baseUrlApi, requestClient, type Result } from '#/api/request';

/** 获取列表 */
export const getLinkage = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/linkage'), {
    params,
  });
};

/** 添加 */
export const postLinkage = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/linkage'), data);
};

/** 编辑 */
export const putLinkage = (data?: any) => {
  return requestClient.put<Result>(
    baseUrlApi(`/portal/admin/linkage/${data.id}`),
    data,
  );
};

/** 删除 */
export const deleteLinkage = (data?: any) => {
  return requestClient.delete<Result>(
    baseUrlApi(`/portal/admin/linkage/${data.id}`),
  );
};
